<template>
	<view>
		<view class="ssList-wrap">
			<view class="u-list">
				<view class="u-list-item" v-for="(item, index) in indexList" :key="index">
					<view @click="saishiInfoClick(item)">
						<u--image :src="item.match.matchImg"  width="720rpx" height="450rpx" :lazy-load="true" />
						<view style="display: flex;justify-content: space-between;align-items: center;padding: 0 20rpx;">
						<view class="ssList-text">
							<u--text :text="item.match.matchTitle" color="#434655" size="16" lineHeight="60rpx"/>
							<u--text mode="date" :text="item.match.createTime" color="#b0b0b0" size="13"/>
						</view>	
						<u-tag :text="item.match.matchStatus=='2'?'已完成':item.match.matchStatus=='1'?'进行中':item.match.matchStatus=='0'?'待开始':''"
						:type="item.match.matchStatus=='2'?'success':item.match.matchStatus=='1'?'':item.match.matchStatus=='0'?'warning':''" 
						plain plainFill size="mini"> </u-tag>	
						</view>
						
					</view>		
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {mapActions} from 'vuex'
	export default {
		props:{
			indexList:{
				type:Array,
				default:[]
			}
		},
		name:"index-saishi",
		data() {
			return {
				
			};
		},
		methods:{
			...mapActions('m_saishi',['getSaishiContentAction']),
			//路由跳转
			goPage(url,obj){
				uni.$u.route(url,obj);
			},
			saishiInfoClick(item){
				this.getSaishiContentAction({matchId:item.matchId,success:(res)=>{
					if(res.data.data.matchTemplate==null) return uni.$u.toast('未配置详情页面')
					this.goPage('/subpkg/saishiXiangqing/saishiXiangqing',{matchId:item.matchId,matchLogo:item.matchLogo,isBm:1})
				}})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.ssList-wrap{margin:0 15rpx;
		.u-list-item{background: #fff;border-radius: 11px;margin-bottom: 10px;overflow: hidden;}
		image{border-top-right-radius: 11px;border-top-left-radius: 11px;}
		.ssList-text{margin:10px 5px;}
	}
</style>